//
//  UIImage+Extension.h
//  UIKit分类整合
//
//  Created by Mr.xu on 2017/1/8.
//  Copyright © 2017年 xuyaguang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface UIImage (Extension)
//由颜色生成图片
+ (UIImage *)imageWithColor:(UIColor*)color;

//由颜色生成图片
+ (UIImage *)imageWithColor:(UIColor*)color size:(CGSize)size;

//将图片剪裁至目标尺寸
+ (UIImage *)imageByScalingAndCroppingForSourceImage:(UIImage *)sourceImage targetSize:(CGSize)targetSize;

//图片旋转角度
- (UIImage *)imageRotatedByDegrees:(CGFloat)degrees;

//拉伸图片UIEdgeInsets
- (UIImage *)resizableImage:(UIEdgeInsets)insets;

//拉伸图片CGFloat
- (UIImage *)imageByResizeToScale:(CGFloat)scale;

//放大图片CGSize
- (UIImage *)imageByResizeWithMaxSize:(CGSize)size;

//小样图图片CGSize
- (UIImage *)imageWithThumbnailForSize:(CGSize)size;

//通过Rect剪裁图片
- (UIImage *)imageByCropToRect:(CGRect)rect;

//图片增加圆角
- (UIImage *)imageByRoundCornerRadius:(CGFloat)radius;


//图片向左90度
- (UIImage *)imageByFlipHorizontal;

//图片向右90度
- (UIImage *)imageByFlipVertical;

//图片转180度
- (UIImage *)imageByRotate180;


@end
